<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }
        .login-container {
            background-color: white;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }
        h1 {
            text-align: center;
            color: #333;
            margin-bottom: 1.5rem;
        }
        .form-group {
            margin-bottom: 1rem;
        }
        input {
            width: 100%;
            padding: 10px;
            margin: 8px 0;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        .captcha-container {
            display: flex;
            gap: 10px;
            align-items: center;
            margin-bottom: 1rem;
        }
        .captcha-image {
            height: 40px;
            border: 1px solid #ddd;
            border-radius: 4px;
            cursor: pointer;
        }


    </style>
</head>
<body>
    <div class="login-container">
        <h1>用户登录</h1>
        <div th:if="${error}" class="error-message" th:text="${error}"></div>
        <form th:action="@{/loginIn}" method="post">

            <div class="form-group">
                <input type="text" id="username" name="username" placeholder="用户名" required >
            </div>
            <div class="form-group">
                <input type="password" name="password" placeholder="密码" required>
            </div>
            <div class="captcha-container">
                <input type="text" name="captcha" placeholder="验证码" required style="flex: 1;">
                <img th:src="@{/captcha}" class="captcha-image" alt="验证码" onclick="this.src='/captcha?t='+new Date().getTime()">
            </div>
            <div class="button-group">
                <button type="submit" style="margin-left: 60px">登录</button>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <button type="reset" style="margin-left: 150px">重置</button>
            </div>
        </form>
    </div>

</body>
</html>

